<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title><?php echo (C("WEBNAME")); ?></title>
	<meta name="keywords" content="<?php echo (C("KEYWORDS")); ?>"/>
	<meta name="description" content="<?php echo (C("DISCRIPTION")); ?>"/>
	<link rel="stylesheet" href="/wenda/Public/Home/Css/common.css" />
	<link rel="stylesheet" type="text/css" href="/wenda/Public/Home/Js/Validform/5.3.2/validform.css"/>
	<script type="text/javascript" src='/wenda/Public/Home/Js/jquery-1.7.2.min.js'></script>
	<script type="text/javascript">
		var APP='/wenda/index.php';
	</script>
	<script type="text/javascript" src='/wenda/Public/Home/Js/top-bar.js'></script>
	<link rel="stylesheet" href="/wenda/Public/Home/Css/index.css" />
	<script type="text/javascript" src='/wenda/Public/Home/Js/index.js'></script>
	<!--<script type="text/javascript" src='/wenda/Public/Home/Js/validate.js'></script>-->
	<script type="text/javascript" src='/wenda/Public/Home/Js/Validform/5.3.2/Validform.min.js'></script>
	<script type="text/javascript">
		$(function(){
			$("#reg").Validform({
				tiptype:3
			});
			$("#logincon").Validform({
				tiptype:function(msg,o,cssctl){
					var objtip=$("#login-msg");
					cssctl(objtip,o.type);
					objtip.text(msg);
				}
			})	
		})
	</script>
</head>
<body>
	<!-- top -->
		<div id='top-fixed'>
	<div id='top-bar'>
		<ul class="top-bar-left fl">
			<li><a href="" target='_blank'>360搜索</a></li>
			<li><a href="" target='_blank'>360官方网站</a></li>
		</ul>
		<ul class='top-bar-right fr'>
			<?php if(isset($_SESSION['username']) && isset($_SESSION['uid'])): ?><li class='userinfo'>
					<a href="<?php echo U('Member/index',array('uid'=>$_SESSION['uid']));?>" class='uname'><?php echo (session('username')); ?></a>
				</li>
				<li style='color:#eaeaf1'>|</li>
				<li><a href="<?php echo U('Login/out');?>">退出</a></li> 
			<?php else: ?>
				<li><a href="" class='login'>登录</a></li>
				<li style='color:#eaeaf1'>|</li>
				<li><a href="" class='register'>注册</a></li><?php endif; ?>
		</ul>
	</div>
<!-- 提问搜索框 -->
	<div id='search'>
		<div class='logo'><a href="<?php echo U('Index/index');?>" class='logo'></a></div>
		<form action="<?php echo U('Search/index');?>" method='get'>
			<input type="text" name='search' class='sech-cons'/>
			<input type="submit" class='sech-btn'/>
		</form>
		<a href="<?php echo U('Ask/index');?>" class='ask-btn'></a>
	</div>
<!-- 提问搜索框结束 -->
</div>
<div style='height:110px'></div>
<!----------导航条---------->
<div id='nav'>
	<ul class='list'>
		<li class='nav-sel'><a href="<?php echo U('Index/index');?>" class='home'>问答首页</a></li>
		<li class='nav-sel ask-cate'>
			<a href="" class='ask-list'><span>问题库</span><i></i></a>
			<ul class='hidden'>
				<?php if(is_array($topCate)): $i = 0; $__LIST__ = $topCate;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><li>
					<a href="<?php echo U('List/index',array('cid'=>$vo['cid'],'where'=>0));?>"><?php echo ($vo["cname"]); ?></a>
				</li><?php endforeach; endif; else: echo "" ;endif; ?>
			</ul>
		</li>
	</ul>
	<p class='total'>累计提问：<?php echo ($askNum); ?></p>
</div>

	<!----------注册框---------->
	<div id='register' class='hidden'>
		<div class='reg-title'>
			<p>欢迎注册后盾问答</p>
			<a href="" title='关闭' class='close-window'></a>
		</div>
		<div id='reg-wrap'>
			<div class='reg-left'>
				<ul>
					<li><span>账号注册</span></li>
				</ul>
				<div class='reg-l-bottom'>
					已有账号，<a href="" id='login-now'>马上登录</a>
				</div>
			</div>
			<div class='reg-right'>
				<form action="<?php echo U('Reg/index');?>" method='post' id='reg' name='register'>
					<ul>
						<li>
							<label for="reg-uname">用户名</label>
							<input type="text" name='username' id='reg-uname' ajaxurl="<?php echo U('Reg/check_user');?>" datatype="s2-14" nullmsg="请填写2-14个字符：字母、数字或中文" errormsg="请填写2-14个字符：字母、数字或中文" sucmsg='验证通过' />
							<span class="Validform_checktip">2-14个字符：字母、数字或中文</span>
						</li>
						<li>
							<label for="reg-pwd">密码</label>
							<input type="password" name='password' id='reg-pwd' datatype="s2-14" nullmsg="请填写6-20个字符:字母、数字或下划线 _" errormsg="请填写6-20个字符:字母、数字或下划线 _" sucmsg='验证通过' />
							<span class="Validform_checktip">6-20个字符:字母、数字或下划线 _</span>
						</li>
						<li>
							<label for="reg-pwded">确认密码</label>
							<input type="password" name='pwded' id='reg-pwded' datatype="*"  recheck="password" nullmsg="请再输入一次密码！" errormsg="您两次输入的账号密码不一致！"  sucmsg='验证通过' />
							<span class="Validform_checktip">请再输入一次密码</span>
						</li>
						<li>
							<label for="reg-verify">验证码</label>
							<input type="text" name='verify' id='reg-verify' ajaxurl="<?php echo U('Reg/check_verify');?>"  datatype="*" nullmsg="请输入验证码" errormsg="验证码不正确"  sucmsg='验证通过' />
							<img src="<?php echo U('Reg/code');?>" width='99' height='35' alt="验证码" id='verify-img' onclick="this.src=this.src+'?'+Math.random()"  />
							<span class="Validform_checktip">请输入图中的字母或数字，不区分大小写</span>
						</li>
						<li class='submit'>
							<input type="submit" value='立即注册'/>
						</li>
					</ul>
				</form>
			</div>
		</div>
	</div>

	<!----------登录框---------->	
	<div id='login' class='hidden'>
		<div class='login-title'>
			<p>欢迎您登录后盾问答</p>
			<a href="" title='关闭' class='close-window'></a>
		</div>
		<div class='login-form'>
			<span id='login-msg' style="background: none;"></span>
			<!-- 登录FORM -->
			<form id='logincon' action="<?php echo U('Login/index');?>" method='post' name='login'>
				<ul>
					<li>
						<label for="login-acc">账号</label>
						<input type="text" name='account' class='input' id='login-acc' ajaxurl="<?php echo U('Login/check_user');?>" datatype="s2-14" nullmsg="请填写2-14个字符：字母、数字或中文" errormsg="请填写2-14个字符：字母、数字或中文" sucmsg='' />
					</li>
					<li>
						<label for="login-pwd">密码</label>
						<input type="password" name='password' class='input' id='login-pwd' datatype="s2-14" nullmsg="请填写6-20个字符:字母、数字或下划线 _" errormsg="请填写6-20个字符:字母、数字或下划线 _" />
					</li>
					<li class='login-auto'>
						<label for="auto-login">
							<input type="checkbox" checked='checked' name='auto'  id='auto-login'/>&nbsp;下一次自动登录
						</label>
						<a href="" id='regis-now'>注册新账号</a>
					</li>
					<li>
						<input type="submit" value='' id='login-btn'/>
					</li>
				</ul>
			</form>
		</div>
	</div>

<!--背景遮罩--><div id='background' class='hidden'></div>
	<!-- top -->
	<div class='main'>
			
	<div id='left'>
			<p class='left-title'>所有问题分类</p>
			<ul class='left-list'>
				<?php if(is_array($cate)): $i = 0; $__LIST__ = $cate;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><li class='list-l1'>
					<div class='list-l1-wrap'>
						<h4><a href="<?php echo U('List/index',array('cid'=>$vo['cid']));?>"><?php echo ($vo["cname"]); ?></a></h4>
						<ul class='list-l2'>
							<?php if(is_array($vo['sub'])): $i = 0; $__LIST__ = array_slice($vo['sub'],0,3,true);if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$sub): $mod = ($i % 2 );++$i;?><li><a href="<?php echo U('List/index',array('cid'=>$sub['cid'],'where'=>0));?>"><?php echo ($sub["cname"]); ?></a></li><?php endforeach; endif; else: echo "" ;endif; ?>
						</ul>
					</div>

					<div class='list-more hidden'>
						<ul>
							<?php if(is_array($vo['sub'])): $i = 0; $__LIST__ = array_slice($vo['sub'],3,null,true);if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$sub): $mod = ($i % 2 );++$i;?><li><a href="<?php echo U('List/index',array('cid'=>$sub['cid'],'where'=>0));?>"><?php echo ($sub["cname"]); ?></a></li><?php endforeach; endif; else: echo "" ;endif; ?>
						</ul>
					</div>
				</li><?php endforeach; endif; else: echo "" ;endif; ?>
			</ul>
		</div>

		<div id='center'>
			<div id='animate'>
				<div class='imgs-wrap'>
					<ul>
						<li>
							<a href=""><img src="/wenda/Public/Home/Images/animate1.jpg" width='558' height='190'/></a>
						</li>
						<li>
							<a href=""><img src="/wenda/Public/Home/Images/animate2.jpg" width='558' height='190'/></a>
						</li>
						<li>
							<a href=""><img src="/wenda/Public/Home/Images/animate3.jpg" width='558' height='190'/></a>
						</li>
					</ul>
				</div>
				<ul class='ani-btn'>
					<li class='ani-btn-cur'>0学费学习<i></i></li>
					<li>超百G原创视频<i></i></li>
					<li style='border:none'>有实力做后盾<i></i></li>
				</ul>
			</div>

			<dl class='answer-list'>
				<dt>
					<span class='wait-as'>待解决问题</span>
					<a href="">更多>></a>
				</dt>
				<?php if(is_array($askList)): $i = 0; $__LIST__ = $askList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><dd>
					<a href="<?php echo U('Show/index',array('asid'=>$vo['asid'],'cid'=>$vo['cid']));?>"><?php echo ($vo["content"]); ?></a>
					<span><?php echo ($vo["answer"]); ?>回答</span>
				</dd><?php endforeach; endif; else: echo "" ;endif; ?>
				
			</dl>

			<dl class='answer-list'>
				<dt>
					<span class='reward-as'>高分悬赏问题</span>
					<a href=''>更多>></a>
				</dt>
				<?php if(is_array($rewardList)): $i = 0; $__LIST__ = $rewardList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><dd>
					<a href="<?php echo U('Show/index',array('asid'=>$vo['asid'],'cid'=>$vo['cid']));?>"><b><?php echo ($vo["gold"]); ?></b><?php echo ($vo["content"]); ?></a>
					<span><?php echo ($vo["answer"]); ?>回答</span>
				</dd><?php endforeach; endif; else: echo "" ;endif; ?>
			</dl>

		</div>
		

		<!-- 右侧 -->
		<div id='right'>
	<?php if(isset($_SESSION['username']) && isset($_SESSION['uid'])): ?><div class='userinfo'>
			<dl>
				<dt>
					<a href="<?php echo U('Member/index',array('uid'=>$loginUser['uid']));?>"><img src="<?php echo ($loginUser["face"]); ?>" width='48' height='48' alt="占位符"/></a>
				</dt>
				<dd class='username'>
					<a href="<?php echo U('Member/index',array('uid'=>$loginUser['uid']));?>"><?php echo (session('username')); ?>
						<b></b>
					</a>
					<a href="<?php echo U('Member/index',array('uid'=>$loginUser['uid']));?>">
						<i class='level lv<?php echo ($loginUser["level"]); ?>' title='Level <?php echo ($loginUser["level"]); ?>'></i>
					</a>
				</dd>
				<dd>金币：<a href="<?php echo U('Member/index',array('uid'=>$loginUser['uid']));?>" style="color: #888888;"><?php echo ($loginUser["gold"]); ?><b class='point'></b></a></dd>
				<dd>经验值：<?php echo ($loginUser["exp"]); ?></dd>
			</dl>
			<table>
				<tr>
					<td>回答数</td>
					<td>采纳率</td>
					<td class='last'>提问数</td>
				</tr>
				<tr>
					<td><a href=""><?php echo ($loginUser["answer"]); ?></a></td>
					<td><a href=""><?php echo ($loginUser["adoptBfb"]); ?>%</a></td>
					<td class='last'><a href=""><?php echo ($loginUser["ask"]); ?></a></td>
				</tr>
			</table>
			<ul>
				<li><a href="<?php echo U('Member/my_ask',array('uid'=>$loginUser['uid']));?>">我提问的</a></li>
				<li><a href="<?php echo U('Member/my_answer',array('uid'=>$loginUser['uid']));?>">我回答的</a></li>
			</ul>
		</div>
	<?php else: ?>		
		 <div class='r-login'>
			<span class='login'><i></i>&nbsp;登录</span>
			<span class='register'><i></i>&nbsp;注册</span>
		</div><?php endif; ?>		
	<div class='clear'></div>
	<div class='star'>
		<p class='title'>后盾问答之星</p>
		<span class='star-name'>本日回答问题最多的人</span>
			<div class='star-info'>
				<div>
					<a href="<?php echo U('Member/index',array('uid'=>$mostToday['uid']));?>" class='star-face'>
						<img src="<?php echo ($mostToday["face"]); ?>" width='48px' height='48px' alt="头像站位"/>
					</a>
					<ul>
						<li><a href="<?php echo U('Member/index',array('uid'=>$mostToday['uid']));?>"><?php echo ($mostToday["username"]); ?></a></li>
						<i class='level lv<?php echo ($mostToday["level"]); ?>' title='Level <?php echo ($mostToday["level"]); ?>'></i>
					</ul>
				</div>
				<ul class='star-count'>
					<li>回答数：<span><?php echo ($mostToday["uanswer"]); ?></span></li>
					<li>采纳率：<span><?php echo ($mostToday["adoptBfb"]); ?>%</span></li>
				</ul>
			</div>
		<span class='star-name'>历史回答问题最多的人</span>

		<div class='star-info'>
			<div>
				<a href="<?php echo U('Member/index',array('uid'=>$mostAnswer['uid']));?>" class='star-face'>
					<img src="<?php echo ($mostAnswer["face"]); ?>" width='48px' height='48px' alt="头像站位"/>
				</a>
				<ul>
					<li><a href="<?php echo U('Member/index',array('uid'=>$mostAnswer['uid']));?>"><?php echo ($mostAnswer["username"]); ?></a></li>
					<i class='level lv<?php echo ($mostAnswer["level"]); ?>' title='Level <?php echo ($mostAnswer["level"]); ?>'></i>
				</ul>
			</div>
			<ul class='star-count'>
				<li>回答数：<span><?php echo ($mostAnswer["answer"]); ?></span></li>
				<li>采纳率：<span><?php echo ($mostAnswer["adoptBfb"]); ?>%</span></li>
			</ul>
		</div>
	</div>
	<div class='star-list'>
		<p class='title'>后盾问答助人光荣榜</p>
		<div>
			<ul class='ul-title'>
				<li>用户名</li>
				<li style='text-align:right;'>帮助过的人数</li>
			</ul>
			<ul class='ul-list'>
				<?php if(is_array($honor)): $k = 0; $__LIST__ = $honor;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($k % 2 );++$k;?><li>
						<a href="<?php echo U('Member/index',array('uid'=>$vo['uid']));?>"><i class='rank r<?php echo ($k); ?>'></i><?php echo ($vo["username"]); ?></a>
						<span><?php echo ($vo["adopt"]); ?></span>
					</li><?php endforeach; endif; else: echo "" ;endif; ?>	
			</ul>
		</div>
	</div>
</div>
		<!-- ---右侧结束---- -->
	</div>
<!--------------------内容主体结束-------------------->
	<div class='clear'></div>
	
<!-- 底部 -->
	<div id='bottom'>
		<p><?php echo (C("COPY")); ?></p>
		<p><?php echo (C("RECORD")); ?></p>
	</div>
<!--[if IE 6]>
    <script type="text/javascript" src="/wenda/Public/Home/Js/iepng.js"></script>
    <script type="text/javascript">
    	DD_belatedPNG.fix('.logo','background');
        DD_belatedPNG.fix('.nav-sel a','background');
        DD_belatedPNG.fix('.ask-cate i','background');
    </script>
<![endif]-->
</body>
</html>
<!-- 底部结束 -->